﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Service
/// </summary>
/// 

[Serializable]
public class QQServiceEntity
{
    private string number;
    public string Number {
        get
        {
            return this.number;
        }
        set
        {
            this.number = value;
            this.ImageUrl = string.Format("http://wpa.qq.com/pa?p=1:{0}:5", this.number);
        }
    }

    public string NickName { get; set; }
    public string ImageUrl { get; set; }
}

[Serializable]
public class QQService : ServiceBase
{
    public const int ItemPrice = 2;

    private List<QQServiceEntity> entities = new List<QQServiceEntity>();
    public QQService()
	{
		//
		// TODO: Add constructor logic here
		//
        //this.entities.Add(new QQServiceEntity() { Number = "123455", NickName = "abc"});
	}

    public List<QQServiceEntity> Select()
    {
        return entities;
    }

    public void Update(int ListIndex, string Number, string NickName)
    {
        entities[ListIndex].Number = Number;
        entities[ListIndex].NickName = NickName;
    }

    public void Delete(int ListIndex)
    {
        this.entities.RemoveAt(ListIndex);
    }

    public List<QQServiceEntity> Entities 
    {
        get
        {
            return this.entities;
        }
        set
        {
            this.entities = value;
        }
   }
}